package com.session04.homework;

import java.util.Comparator;

public class PokerComparator implements Comparator<Poker> {

    @Override
    public int compare(Poker o1, Poker o2) {
        if(o1.getNumValue() > o2.getNumValue()){
            return -1;
        }else if(o1.getNumValue() < o2.getNumValue()){
            return 1;
        }else{
            if(o1.getColorValue() > o2.getColorValue()){
                return -1;
            }else if(o1.getColorValue() < o2.getColorValue()){
                return 1;
            }
        }
        return 0;
    }
}
